package com.cn

import com.cn.dto.Cat
import com.cn.dto.Dog
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
import java.time.LocalDateTime

@SpringBootApplication
@RestController
@RequestMapping("app")
open class App {
    @GetMapping("tt")
    fun test(): String {
        return " App pon——${LocalDateTime.now()}"
    }
}

fun main(args: Array<String>) {

    val context = runApplication<App>(*args)
    val mapping = context.getBean(RequestMappingHandlerMapping::class.java)
    println("App started!")
    println()
    mapping.handlerMethods.forEach { t, u -> println("$t -> $u") }
}